package cn.sanch.basic.util;


/**
 * 封装增删改时响应给前端的数据
 * 后端给前端的数据
 * @author PC
 *
 */
public class AjaxResult {


	private Boolean success = true;
	private String message = "操作成功";
	private Object resultObj;

	/**
	 * 自己创建自己
	 * @return 返回的是自己创建的一个自己对象
	 */
	public static AjaxResult me() {
		return new AjaxResult();
	}

	/**
	 * 链式编程
	 * @param success 传入一个布尔类型的值
	 * @return 返回的还是自己【AjaxResult】
	 */
	public AjaxResult setSuccess(Boolean success) {
		this.success = success;
		return this;
	}

	public AjaxResult setMessage(String message) {
		this.message = message;
		return this;
	}

	public AjaxResult setResultObj(Object resultObj) {
		this.resultObj = resultObj;
		return this;
	}

	public Boolean getSuccess() {
		this.success = success;
		return success;
	}

	public String getMessage() {
		this.message = message;
		return message;
	}

	public Object getResultObj() {
		this.resultObj = resultObj;
		return resultObj;
	}
}
